Skip to content

Port verifyCompilerOptions, error on things removed from this repo #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jul 11, 2025

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Jul 10, 2025

This ports most of verifyCompilerOptions, along with new checks that complain about baseUrl and outFile. baseUrl has a "fancy" error:

~/work/TypeScript-go/built/local/tsgo
tsconfig.json:4:5 - error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration.
  Use '"paths": {"*": "./src/*"}' instead.

4     "baseUrl": "./src",
      ~~~~~~~~~

Found 1 error in tsconfig.json:4

It also removes all of the options previously deprecated in 5.0 and "removed" in 5.5. Now they are just unsupported options, with no references in the code.

Probably easiest to view this PR with filters: https://github.com/microsoft/typescript-go/pull/1381/files?file-filters%5B%5D=.diff&file-filters%5B%5D=.go

Closes #1376
Closes #807
For #1247

@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 02:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates compiler test baselines to reflect the new TS5102 errors for options removed from the repo (like outFile, baseUrl, etc.). It replaces older error messages and <no content> placeholders across various *.errors.txt, *.diff, and sourcemap baseline files.

  • Replace old error codes and messages with error TS5102: Option '<option>' has been removed...
  • Remove <no content> markers and align baseline structure consistently
  • Update numerous sourcemap and .js.map.diff baselines to match the new concatenation logic

Reviewed Changes

Copilot reviewed 290 out of 464 changed files in this pull request and generated no comments.

File Description
testdata/baselines/reference/submodule/compiler/sourceMapWithNonCaseSensitiveFileNames.errors.txt Updated baseline to TS5102 for removed outFile option
testdata/baselines/reference/submodule/compiler/requireOfJsonFile_PathMapping.errors.txt Added TS5102 for removed baseUrl with replacement suggestion
testdata/baselines/reference/submodule/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.errors.txt.diff Cleaned up <no content> placeholder and updated to TS5102 removal error
Comments suppressed due to low confidence (1)

testdata/baselines/reference/submodule/compiler/outModuleConcatUnspecifiedModuleKindDeclarationOnly.errors.txt.diff:12

  • There is an extra leading space before ==== a.ts, which is inconsistent with other baseline diffs. Please remove the leading space to align with the existing format.
 ==== a.ts (0 errors) ====

@JakobJingleheimer
Copy link

Nice! I might remove the Please remove it from your configuration. from the message; IMO it just adds words.

This is nicely succinct and the instruction is clear.

tsconfig.json:4:5 - error TS5102: Option 'baseUrl' has been removed. Use '"paths": {"*": "./src/*"}' instead.

@jakebailey
Copy link
Member Author

This is the format we've previously used for deprecations; I could do what you suggest but I'd have to create custom diagnostics not in the repo (which is fine, but sort of weird).

moduleKind := options.GetEmitModuleKind()

if options.AllowImportingTsExtensions.IsTrue() && !(options.NoEmit.IsTrue() || options.EmitDeclarationOnly.IsTrue() || options.RewriteRelativeImportExtensions.IsTrue()) {
createOptionValueDiagnostic("allowImportingTsExtensions", diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a Strada bug - the message here should mention RewriteRelativeImportExtensions as a third out

@jakebailey jakebailey requested a review from RyanCavanaugh July 11, 2025 00:01
@jakebailey jakebailey enabled auto-merge July 11, 2025 00:02
@jakebailey jakebailey added this pull request to the merge queue Jul 11, 2025
Merged via the queue into main with commit 678ab6f Jul 11, 2025
21 of 22 checks passed
@jakebailey jakebailey deleted the jabaile/verify-compiler-options branch July 11, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Cannot find module" when switching from tsc to tsgo Inherited baseUrl is not respected
3 participants